#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "InputPin.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class ValueSpecification;

/// <summary>
/// ValuePin
/// A ValuePin is an InputPin that provides a value by evaluating a
/// ValueSpecification.
/// </summary>
class UMLMODEL_EXPORT ValuePin : public InputPin {

public: // Constructors and destructors
    explicit ValuePin(const QString& umlType="uml::ValuePin");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// value getter
    /// The ValueSpecification that is evaluated to obtain the value that the ValuePin
    /// will provide.
    /// </summary>
    shared_ptr<ValueSpecification> value() const;

    /// <summary>
    /// value setter
    /// The ValueSpecification that is evaluated to obtain the value that the ValuePin
    /// will provide.
    /// </summary>
    void setValue(shared_ptr<ValueSpecification> value);

private: // Fields
    /// <summary>
    /// value
    /// The ValueSpecification that is evaluated to obtain the value that the ValuePin
    /// will provide.
    /// </summary>
    shared_ptr<ValueSpecification> value_;

};

} // namespace uml
